package ctrl;

//prints from GUI
public class Chat {

	public static void broadcast(String text, Control ctrl) {
		if (text.equals("debug") || text.equals("DEBUG") || text.equals("Debug")){
			ctrl.debug = !ctrl.debug;
			if (ctrl.debug)
				ctrl.println("System::Entered debug mode");
			else
				ctrl.println("System::Left debug mode");}
		else {
			ctrl.println("Me: " + text);
			ctrl.getNet().sendString(ctrl.getUsr().getName() + ": " + text, 1);
		}
	}

	// prints text from NetMgt
	public static void receive(String msg, Control gui) {
		gui.println(msg);
	}

}
